package com.itheima.variable;

import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        //1.使用键盘录入一个3位数
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个三位数");
        int num = sc.nextInt();
        //个位 计算数值%10
        int ge = num % 10;
        //十位计算数值/10%10
        int shi = num /10 % 10;
        //百位计算数值/10/10%10
        // 其他 同理 /10/10.....%10
        int bai = num / 100;
        System.out.println("整数"+num+"个位为"+ge);
        System.out.println("整数"+num+"十位为"+shi);
        System.out.println("整数"+num+"百位为"+bai);



    }
}
